<?php

namespace App\Http\Requests\Cms;

use Illuminate\Foundation\Http\FormRequest;

class AdRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'pos_id' => 'required|integer',
            'title' => 'required|max:255',
            'thumb' => 'required|max:255',
            'url' => 'required|max:255',
            'starttime' => 'required|date',
            'endtime' => 'required|date',
            'sort' => 'required|integer|min:0',
            'status' => 'required|in:0,1',
        ];
    }
    public function attributes()
    {
        return [
            'pos_id' => ' 广告位',
            'title' => '标题',
            'thumb' => '图片',
            'url' => '链接地址',
            'starttime' => '开始时间',
            'endtime' => '结束时间',
            'sort' => '排序',
            'status' => '状态',
        ];
    }
}
